package com.xm;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * @Author：xm
 * @Project：runoob
 * @Date：2024/7/15 22:55
 */

public class ReverseSerializable07 {
    public static void main(String[] args) {
        Serializable072 serializable072 = null;

        try {
            FileInputStream fileInputStream = new FileInputStream("serializable072.ser");
            ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
            serializable072 = (Serializable072) objectInputStream.readObject();
            objectInputStream.close();
            fileInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        } catch (ClassNotFoundException e) {
            System.out.println("Serializable072 class not found");
            e.printStackTrace();
            return;
        }
        System.out.println("Deserialized Serializable072...");
        System.out.println("Name: " + serializable072.name);
        System.out.println("Address: " + serializable072.address);
        System.out.println("SSN: " + serializable072.SSN);
        System.out.println("Number: " + serializable072.number);
    }
}
